﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bacon_FTP_Client
{
    /// <summary>
    /// Constants Commands Class for the FTP Client.
    /// </summary>
    public static class Constants
    {
        /// <summary>
        /// User.
        /// Character string allowing the user to be identified. 
        /// User identification is necessary to establish communication over the data channel.
        /// </summary>
        public const string userCmd = "USER";
        /// <summary>
        /// Password.
        /// Character string specifying the user's password. 
        /// This command must immediately precede the USER command. 
        /// It falls to the client to hide the display of this command for security reasons.
        /// </summary>
        public const string passCmd = "PASS";
        /// <summary>
        /// Account.
        /// Character string representing the user's account. 
        /// The command is generally not necessary. 
        /// During the response accepting the password, if the response is 230 this stage is not necessary, if the response is 332, it is.
        /// </summary>
        public const string acctCmd = "ACCT";
        /// <summary>
        /// Change Working Directory.
        /// This command enables the current directory to be changed. 
        /// This command requires the directory's access path to be fulfilled as an argument.
        /// </summary>
        public const string cwdCmd  = "CWD";
        /// <summary>
        /// Change to Parent Directory. 
        /// This command allows you to go back to the parent directory. 
        /// It was introduced to solve problems of naming the parent directory according to the system (generally "..").
        /// </summary>
        public const string cdupCmd = "CDUP";
        /// <summary>
        /// Structure Mount.
        /// This command allows the user to mount a different file system without altering his login or accounting information. 
        /// Transfer parameters are similarly unchanged. 
        /// You can specify a pathname or directory. On many modern systems this command is unimplemented due to security risks.
        /// </summary>
        public const string smntCmd = "SMNT";
        /// <summary>
        /// Reinitialize.
        /// This command will terminate the USER session and purge all account information. 
        /// It will allow any transfer in progress to be completed. 
        /// The session will be reset to the default settings and the connection is left open. 
        /// This is identical to the state immediately after the connection is opened. 
        /// A USER command may be issued to login.
        /// </summary>
        public const string reinCmd = "REIN";
        /// <summary>
        /// Quit.
        /// Command enabling the current session to be terminated. 
        /// The server waits to finish the transfer in progress if the need arises, then supplies a response before closing the connection.
        /// </summary>
        public const string quitCmd = "QUIT";
        /// <summary>
        /// Port.
        /// Character string allowing the port number used to be specified.
        /// </summary>
        public const string portCmd = "PORT";
        /// <summary>
        /// Passive.
        /// Command making it possible to indicate to the DTP server to stand by for a connection on a specific port chosen randomly from among the available ports. 
        /// The response to this command is the IP address of the machine and port.
        /// </summary>
        public const string pasvCmd = "PASV";
        /// <summary>
        /// Type.
        /// This command enables the type of format in which the data will be sent to be specified.
        /// </summary>
        public const string typeCmd = "TYPE";
        /// <summary>
        /// Structure.
        /// Telnet character specifying the file structure (F for File, R for Record, P for Page).
        /// </summary>
        public const string struCmd = "STRU";
        /// <summary>
        /// Mode.
        /// Telnet character specifying data transfer method (S for Stream, B for Block, C for Compressed).
        /// </summary>
        public const string modeCmd = "MODE";
        /// <summary>
        /// Retrieve.
        /// This command (RETRIEVE) asks the server DTP for a copy of the file whose access path is given in the parameters.
        /// </summary>
        public const string retrCmd = "RETR";
        /// <summary>
        /// Store.
        /// This command (store) asks the server DTP to accept the data sent over the data channel and store them in a file bearing the name given in the parameters. 
        /// If the file does not exist, the server creates it, if not it overwrites it.
        /// </summary>
        public const string storCmd = "STOR";
        /// <summary>
        /// Store Unique.
        /// This command is identical to the previous one, only it asks the sever to create a file where the name is unique. 
        /// The name of the file is returned in the response.
        /// </summary>
        public const string stouCmd = "STOU";
        /// <summary>
        /// Append.
        /// Thanks to this command (append) the data sent is concatenated into the file bearing the name given in the parameter if it already exists, if not, it is created.
        /// </summary>
        public const string appeCmd = "APPE";
        /// <summary>
        /// Allocate.
        /// This command (allocate) asks the server to plan a storage space big enough to hold the file whose name is given in the argument.
        /// </summary>
        public const string alloCmd = "ALLO";
        /// <summary>
        /// Restart.
        /// This command (restart) enables a transfer to be restarted from where it stopped. 
        /// To do so, the command sends the marker representing the position in the file where the transfer had been interrupted in the parameter. 
        /// This command must immediately follow a transfer command.
        /// </summary>
        public const string restCmd = "REST";
        /// <summary>
        /// Rename From.
        /// This command (rename from) enables a file to be renamed. 
        /// In the parameters it indicates the name of the file to be renamed and must be immediately followed by the RNTO command.
        /// </summary>
        public const string rnfrCmd = "RNFR";
        /// <summary>
        /// Rename To.
        /// This command (rename to) enables a file to be renamed. 
        /// In the parameters it indicates the name of the file to be renamed and must be immediately followed by the RNFR command.
        /// </summary>
        public const string rntoCmd = "RNTO";
        /// <summary>
        /// Abort.
        /// This command (abort) tells the server DTP to abandon all transfers associated with the previous command. 
        /// If no data connection is open, the DTP sever does nothing, if not it closes it. 
        /// The control channel however remains open.
        /// </summary>
        public const string aborCmd = "ABOR";
        /// <summary>
        /// Delete.
        /// This command (delete) allows a file to be deleted, the name of which is given in the parameters. 
        /// This command is irreversible, confirmation can only be given at client level.
        /// </summary>
        public const string deleCmd = "DELE";
        /// <summary>
        /// Remove Directory.
        /// This command (remove directory) enables a directory to be deleted. 
        /// The name of the directory to be deleted is indicated in the parameters.
        /// </summary>
        public const string rmdCmd  = "RMD";
        /// <summary>
        /// Make Directory.
        /// This command (make directory) causes a directory to be created. 
        /// The name of the directory to be created is indicated in the parameters.
        /// </summary>
        public const string mkdCmd  = "MKD";
        /// <summary>
        /// Print Working Directory.
        /// This command (print working directory) makes it possible to resend the complete current directory path.
        /// </summary>
        public const string pwdCmd  = "PWD";
        /// <summary>
        /// List.
        /// This command allows the list of files and directories present in the current directory to be resent. 
        /// This is sent over the passive DTP. 
        /// It is possible to place a directory name in the parameter of this command, the server DTP will send the list of files in the directory placed in the parameter.
        /// </summary>
        public const string listCmd = "LIST";
        /// <summary>
        /// Name List.
        /// This command (name list) enables the list of files and directories present in the current directory to be sent.
        /// </summary>
        public const string nlstCmd = "NLST";
        /// <summary>
        /// Site Parameters.
        /// This command (site parameters) causes the server to offer specific services not defined in the FTP protocol.
        /// </summary>
        public const string siteCmd = "SITE";
        /// <summary>
        /// System.
        /// This command (system) allows information on the remote server to be sent.
        /// </summary>
        public const string systCmd = "SYST";
        /// <summary>
        /// Status.
        /// This command (status) makes it possible to transmit the status of the server, for example to know the progress of a current transfer. 
        /// This command accepts an access path in the argument, it then returns the same information as LIST but over the control channel.
        /// </summary>
        public const string statCmd = "STAT";
        /// <summary>
        /// Help.
        /// This command gives all the commands understood by the server. 
        /// The information is returned on the control channel.
        /// </summary>
        public const string helpCmd = "HELP";
        /// <summary>
        /// No Operation.
        /// This command (no operations) is only used to obtain an OK command from the server. 
        /// It can only be used in order not to be disconnected after an excessive period of inactivity.
        /// </summary>
        public const string noopCmd = "NOOP";
    }
}
